﻿using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using housingsafety.server.Helpers;
using housingsafety.server.Models;
using Microsoft.AspNetCore.Http;

namespace housingsafety.server.Svcs
{
    /// <summary>
    /// 图像存储
    /// </summary>
    public interface IImageStorageProvider
    {
        /// <summary>
        /// 提供程序名称
        /// </summary>
        string ProviderName { get; }
        /// <summary>
        /// 获取对象流
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <param name="userName">用户名称</param>
        /// <param name="groupName">分组名称</param>
        /// <returns>对象流</returns>
        Task<Stream> GetImageStreamAsync(string fileId, string userName, string groupName);

        /// <summary>
        /// 存储文件
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <param name="formFile">文件流</param>
        /// <param name="userName">用户名称</param>
        /// <param name="groupName">分组名称</param>
        /// <returns>文件路径</returns>
        Task<RespRet<FileIndex>> StoreFormFileAsync(IFormFile formFile, string fileId, string userName, string groupName);
    }
}
